/**
 * Created with IntelliJ IDEA.
 * Description：
 * User：user
 * DATE:2021-10-23
 * Time:19:24
 */
//顺序表适合于频繁的插入和删除元素
    //如果是要频繁的插入和删除不适合顺序表，每次都要移动大量的元素，扩容可能造成内存的浪费
    //链表的使用
    //单双向链表
    //有头结点没有头结点
    //循环和非循环
    //逻辑上连续物理上不一定连续
public class TestDemo {
    public static void main(String[] args) {
        MyLinkedList myLinkedList = new MyLinkedList();
        //myLinkedList.createLinkedList();
        myLinkedList.addFirst(1);
        myLinkedList.addFirst(1);
        myLinkedList.addFirst(5);
        myLinkedList.addFirst(4);
       // myLinkedList.addLast(2);
       // myLinkedList.addIndex(1,10);
       // myLinkedList.addIndex(2,12);
        // myLinkedList.show();
       /* myLinkedList.remove(4);
        myLinkedList.remove(3);*/
        myLinkedList.removeAllKey(1);
        myLinkedList.show();
//        System.out.println(myLinkedList.getSize());
//      System.out.println(myLinkedList.contains(4));
//       System.out.println(myLinkedList.contains(5));
       myLinkedList.clear();
       System.out.println("aaaa");

    }
}
